The class for searching in feindura pages.
array | $adminConfig | Contains the admin-settings config set in the CMS backend. |
array | $categoryConfig | Contains the categories-settings config set in the CMS backend. |
bool | $searchAllLanguages | Whether to search in all languages or not. (Helper variable) |
false|string | $language | The language in which should be searched, if FALSE it searches in all languages |
int|false | $limitResults | If its an number it limits the found results in a page to this number, so the search results are still displayable, when a lot of words were found. |
bool | $onlyPublic | If TRUE it only search in pages and categories which are public. |
bool | $checkPermissions | If TRUE it will check if the current user has the right to edit the searched page. |
bool | $searchInCategoryNames | if TRUE it also search in the category names. |
string | $markStartTag | The start-tag to mark the finding in a text. |
string | $markEndTag | The end-tag to mark the finding in a text. |
void | __construct() | The constructor of the class, sets the $categoryConfig . Used Global Variables $categoryConfig the... |
array | find() | Starts a search. |
array|false | searchPages() | Goes through pages and search for a matching of the searchwords. Return the results sorted by priority. |
array | createResultsArray() | Create an array with the page title and content, with marked findings, ready to display in a HTML page. Example of... |
string | markFindingInText() | Marks the results from preg_match_all() in the given texts. |
string|false | markFindingInDataString() | Marks the results from preg_match_all() in a given serialized dataString. Example dataString: Show Example... |
Contains the admin-settings config set in the CMS backend.
The file with the admin-settings config array is situated at "feindura-CMS/config/admin.config.php".
This settings will be set to this property in the search constructor.
Example array:
Show Example
Contains the categories-settings config set in the CMS backend.
The file with the categories-settings config array is situated at "feindura-CMS/config/category.config.php".
This settings will be set to this property in the search constructor.
Example array:
Show Example
Whether to search in all languages or not. (Helper variable)
The language in which should be searched, if FALSE it searches in all languages
If its an number it limits the found results in a page to this number, so the search results are still displayable, when a lot of words were found.
If FALSE all results will be displayed.
If TRUE it only search in pages and categories which are public.
If TRUE it will check if the current user has the right to edit the searched page.
if TRUE it also search in the category names.
The start-tag to mark the finding in a text.
false|string | $language |
The language in which should be searched, if FALSE it searches in all languages Default false |
Type constructor
The constructor of the class, sets the $categoryConfig.
Used Global Variables
string | $searchwords |
one or more searchwords to fing |
bool|int|array | $category |
(optional) the ID or an array with IDs of the category(ies) in which should be searched, if TRUE it searches in all categories, if FALSE it searches only in the non category Default true |
Name find()
Starts a search.
string | $searchwords |
one or more searchwords to fing |
bool|int|array | $category |
the ID or an array with IDs of the category(ies) in which should be searched, if TRUE it searches in all categories, if FALSE it searches only in the non category |
Name searchPages()
Goes through pages and search for a matching of the searchwords. Return the results sorted by priority.
array | $results |
an array with the search results created by the searchPages() method. |
Name createResultsArray()
Create an array with the page title and content, with marked findings, ready to display in a HTML page.
Example of the returned array
Show Example
string markFindingInText ( |
string $text, array $results, [false@int $extractMax = false]) |
string | $text |
the text where the result was found to mark the rsult in it |
array | $results |
an array with the search results in the format: array[0][0] = 'found text', array[0][1] = 25, array[1][0] = 'other text', ... |
false@int | $extractMax |
the maximal number of letters before and after the finding, if FALSE it returns the whole text Default false |
Name markFindingInText()
Marks the results from preg_match_all() in the given texts.
string | $dataString |
a dataString |
array | $results |
an array with the search results in the format: array[0][0] = 'found text', array[0][1] = 25, array[1][0] = 'other text', ... |
Name markFindingInDataString()
Marks the results from preg_match_all() in a given serialized dataString.
Example dataString:
Show Example